import axios from 'axios';

const API_URL = 'http://localhost:8080/api/users';
import request from '@/utils/request'

export function getUsers() {
  return request({
    url: '/api/users',
    method: 'get'
  })
}

export default {
  getAllUsers() {
    return axios.get(API_URL);
  },
  createUser(userData) {
    return axios.post(API_URL, userData);
  },
  updateUser(userId, userData) {
    return axios.put(`${API_URL}/${userId}`, userData);
  },
  deleteUser(userId) {
    return axios.delete(`${API_URL}/${userId}`);
  }
};
